{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 06 语句书写规范"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.【填空】请写出下列语句的输出结果：（ ）  \n",
    "`\n",
    "i = 2  \n",
    "j = 3  \n",
    "z = i,j  \n",
    "print(z)`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：(2, 3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.【选择】以下哪一个语句不可以打印出\"hello world\"字符串（结果需在同一行）？（ ）\n",
    "\n",
    "A.  \n",
    "print('hello \\  \n",
    "world')  \n",
    "B.  \n",
    "print(\"hello world\")  \n",
    "C.  \n",
    "print('''hello   \n",
    "world''')  \n",
    "D.  \n",
    "print('hello world')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：C"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.【填空】Python通常缩进单位为（ ）个空格"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.【改错】请更改下列代码的错误。  \n",
    "`sum = 0;  \n",
    "for i in range(1,5)  \n",
    "    sum = sum + i;  \n",
    "  print(i)  \n",
    "print(sum)`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：  \n",
    "`sum = 0  \n",
    "for i in range(1,5):   \n",
    "    sum = sum + i   \n",
    "    print(i)   \n",
    "print(sum)`"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
